﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using PaathshalaClient.UI.Common;
using System.Diagnostics;

namespace PaathshalaClient.UI
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void ApplicationStartup(StartupEventArgs e)
        {
            try
            {
                var model = new UserLoginModel { CancelButtonText = "Cancel", OKButtonText = "Login", 
                    GroupBoxHeaderText="Login Details",
                    PasswordLabelText = "Password", UserLabelText = "User Name" };
                var login = new UserLoginView();
                login.DataContext = model;
                var result = login.ShowDialog();
                if (result == false)
                {
                  Application.Current.Shutdown();                    
                }

               
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }

        protected override void OnStartup(StartupEventArgs e)
        {
            ApplicationStartup(e);
        }

        [STAThreadAttribute]
        public static int Main(string[] args)
        {
            App app = new App();         
            app.Run();
            return 0;
        }
    }
}
